package com.creatorblue.modules.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.Date;

/**
 * @author huj
 * @create 2022-01-15 9:29
 * @email hujun@creatorblue.com
 */
public class HelloJob implements Job {

    private String message;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    /*@Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        System.out.println(jobExecutionContext.getTrigger().getJobDataMap().get("message")); // 输出TriggerMessage
        System.out.println(jobExecutionContext.getJobDetail().getJobDataMap().get("message")); // 输出JobDetailMessage
        System.out.println(jobExecutionContext.getMergedJobDataMap().get("message")); // 输出TriggerMessage
        System.out.println(new Date());
    }*/

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        System.out.println(message); // 输出TriggerMessage
        System.out.println(new Date());
    }

}
